Textbook: Introduction to the Theory of Computation, by Michael Sipser (3rd Edition)
“What are the fundamental capabilities and limitations of computers?”
Set: A collection of distinct objects (elements).
\{ 1,2,3 \} \\ \tiny\textit{(represented with brackets)}
Relevant Notes: CS1300 - Set Theory Basics
Things to know: Describing sets, union/intersection/complement, power set, cartesian product
Sequence: A collection of distinct objects in some order.
( 1,2,3 ) \\ \tiny\textit{(represented with parenthesis)}
Sets v.s. Sequences:
- Order doesn’t matter in sets, but it does in sequences.
- Repetition doesn’t matter in sets, but it does in sequences.
g(x) = 2x, \forall x \in Z \\ D: Z \\ T: \{ y | y \text{ is even} \}
Function: Objects that sets up an input-output relationship.
f: D \to R \\ \tiny\textit{Notation for saying $f$ has a domain $D$ and range $R$}
Example: Functions are sets of mappings
D T A_1 Lily A_2 Max A_2 Max \{ (A_1, Lily), (A_2, Max), (A_3, Max), \}
Arguments: A function’s k-tuple input.
Predicate: Function whose range is \{\text{TRUE}, \text{FALSE}\}.
Relation: A predicate whose domain is a set of k-tuples.
Equivalence Relation Definition: A binary relation R is an equivalence relation if:
- R is reflexive if for every x, xRx
- R is symmetric if for every x, xRy implies yRx
- R is reflexive if for every x, y, and z, xRx and yRx implies xRz
Graph: Set of nodes with edges connecting some of them.
Directed Graph: Graph where the edges have directions.
Formally Describing Graphs:
- Graphs are described as G = (V, E), where V is the set of nodes and E is the set of edges, represented as pairs like (i, j).
- For E, order of i and j only matters in a directed graph. G = (\{1, 2, 3\}, \{ (1,2), (2,3), (3,1) \}) \\ \tiny\textit{Example graph description}
Path: Sequence of nodes connected by edges.
More Graph Types:
When are Directed Graphs Useful?
- Directed graphs are good at depicting binary relations.
Alphabet: Any nonempty finite set.
\Sigma_1 = \{ \texttt{b,c,d,f,g,h,j,k,l,m,n,p,q,r,s,t,v,w,x,y,z} \} \\ \tiny\textit{An example alphabet}
String over an Alphabet: A finite sequence of symbols from that alphabet.
Note: Strings are tuples.
\texttt{MARIO} = (M, A, R, I, O)
More on Strings:
Ordering Strings:
Example of Shortlex Order: Shortlex order of all strings over the alphabet \{ \texttt{ U, W } \}
(\epsilon,\texttt{ U},\texttt{ W},\texttt{ UU},\texttt{ UW},\texttt{ WU},\texttt{ WW},\texttt{ UUU},...)
Prefix: String x is a prefix of string y if a string z exists where xz = y
Language: A set of strings.
Boolean Logic: Mathematical system built around TRUE
and FALSE
.
Relevant Notes: CS1300 - Formal Logic
Things to know: Binary connectives (\land, \lor, \leftrightarrow), tautological equivalence between \rightarrow and \lor, binary operations, distributive law
- The only uncovered operation is XOR (exclusive or) \oplus.
All Boolean operations can be rewritten in terms of AND and NOT operations.
Example: \begin{align*} P \lor Q \qquad & \qquad (P' \land Q')' \\ P \to Q \qquad & \qquad P' \lor Q \\ P \leftrightarrow Q \qquad & \qquad ( P \to Q ) \land (Q \to P) \\ P \oplus Q \qquad & \qquad (P \leftrightarrow Q)' \end{align*}
Distributive Law:
- P \land (Q \lor R) = (P \land Q) \lor (P \land R)
- P \lor (Q \land R) = (P \lor Q) \land (P \lor R)
In-Class Whiteboard: Reviewing logic
p q p \to q q \to p p' \to q' q' \to p' F F T T T T F T T F F T T F F T T F T T T T T T
- Remember: If p is false, we assume p \to q to be true.
Observations:
- These are functions, and functions are sets of tuples.
- p \to q = q' \to p': Contrapositive is logically equivalent to the original condition.
- The converse q \to p is not equivalent to the original.
- The inverse p' \to q' is equivalent to the converse.
Sub-Question: Why are there four rows?
q and p are sets of true and false.
q,p \in B = \{F, T\}
The possible outputs is | B^2 | = 2^2 = 4
In this course we’ll need to know proof by contradiction.